package com.fz.us.oa.core.entity.com;

import com.fz.us.admin.company.entity.BaseFlowEntity;
import com.fz.us.admin.company.entity.User;
import com.fz.us.admin.dict.entity.DictItem;

import javax.persistence.*;
import java.util.Date;
import java.util.Set;

/**
 * 业务实体类 - 日程安排登记表
 * ============================================================================
 * 版权所有 2016 。
 *
 * @author XuHeng
 * @version 1.0 2016-12-22 。
 * ============================================================================
 */
@Entity
@Table(name="ec_schedule")
public class Schedule extends BaseFlowEntity {

    private static final long serialVersionUID = -2885428848487350367L;
    /**
     * 日程类型字典项
     */
    private DictItem scheDictItem;
    /**
     * 主题
     */
    private String subject;
    /**
     * 开始日期
     */
    private Date datStart;
    /**
     * 开始时间
     */
    private Date timStart;
    /**
     * 结束日期
     */
    private Date datEnd;
    /**
     * 结束时间
     */
    private Date timEnd;

    /**
     * 参与人员
     */
    private Set<User> participants;
    /**
     * 是否公开 1:是 0:否
     */
    private int isPublic;
    /**
     * 具体地点
     */
    private String address;

    /**
     * 提交日期
     */
    private Date dateApply;
    /**
     * 文档状态数值
     */
    private int numStatus;
    /**
     * 文档状态文字
     */
    private String txtStatus;

    /**
     * 表单名称
     */
    private String form;

    @Column(nullable=false, columnDefinition = "varchar(50) default '日程安排登记表'")
    public String getForm() {
        return form;
    }

    public void setForm(String form) {
        this.form = form;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public DictItem getScheDictItem() {
        return scheDictItem;
    }

    public void setScheDictItem(DictItem scheDictItem) {
        this.scheDictItem = scheDictItem;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public Date getDatStart() {
        return datStart;
    }

    public void setDatStart(Date datStart) {
        this.datStart = datStart;
    }

    public Date getTimStart() {
        return timStart;
    }

    public void setTimStart(Date timStart) {
        this.timStart = timStart;
    }

    public Date getDatEnd() {
        return datEnd;
    }

    public void setDatEnd(Date datEnd) {
        this.datEnd = datEnd;
    }

    public Date getTimEnd() {
        return timEnd;
    }

    public void setTimEnd(Date timEnd) {
        this.timEnd = timEnd;
    }

    @ManyToMany(fetch = FetchType.LAZY)
    @OrderBy("pinYinHead asc")
    public Set<User> getParticipants() {
        return participants;
    }

    public void setParticipants(Set<User> participants) {
        this.participants = participants;
    }

    public int getIsPublic() {
        return isPublic;
    }

    public void setIsPublic(int isPublic) {
        this.isPublic = isPublic;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Date getDateApply() {
        return dateApply;
    }

    public void setDateApply(Date dateApply) {
        this.dateApply = dateApply;
    }

    public int getNumStatus() {
        return numStatus;
    }

    public void setNumStatus(int numStatus) {
        this.numStatus = numStatus;
    }

    public String getTxtStatus() {
        return txtStatus;
    }

    public void setTxtStatus(String txtStatus) {
        this.txtStatus = txtStatus;
    }
}
